class Question {
  final int id;
  final String text;
  final List<String> options;
  final String category;

  Question({
    required this.id,
    required this.text,
    required this.options,
    required this.category,
  });
}

// 基本信息模型
class BasicInfo {
  final String age;
  final String gender;
  final String occupation;
  final String sleepCondition;

  BasicInfo({
    required this.age,
    required this.gender,
    required this.occupation,
    required this.sleepCondition,
  });

  Map<String, dynamic> toJson() {
    return {
      'age': age,
      'gender': gender,
      'occupation': occupation,
      'sleep_condition': sleepCondition,
    };
  }
}

// SCL-90问题模型
class SCLQuestion {
  final int id;
  final String text;
  final String category;

  SCLQuestion({required this.id, required this.text, required this.category});
}

// 问卷数据类
class QuestionnaireData {
  // SCL-90评分选项
  static List<String> get scaleOptions => ['没有', '很轻', '中等', '偏重', '严重'];

  // 基本信息选项
  static List<String> get ageRanges => [
    '18岁以下',
    '18-25岁',
    '26-35岁',
    '36-45岁',
    '46-55岁',
    '56-65岁',
    '65岁以上',
  ];

  static List<String> get genderOptions => ['男', '女', '其他'];

  static List<String> get occupationOptions => [
    '学生',
    '教师',
    '医护人员',
    '企业员工',
    '公务员',
    '个体经营',
    '退休人员',
    '无业/待业',
    '其他',
  ];

  static List<String> get sleepOptions => [
    '睡眠质量很好',
    '偶尔失眠',
    '经常失眠',
    '严重失眠',
    '需要药物辅助睡眠',
  ];

  // SCL-90问题列表
  static List<SCLQuestion> getSCLQuestions() {
    return [
      SCLQuestion(id: 1, text: '头痛', category: '躯体化'),
      SCLQuestion(id: 2, text: '神经过敏，心中不踏实', category: '强迫症状'),
      SCLQuestion(id: 3, text: '头脑中有不必要的想法或字句盘旋', category: '强迫症状'),
      SCLQuestion(id: 4, text: '头昏或昏倒', category: '躯体化'),
      SCLQuestion(id: 5, text: '对异性的兴趣减退', category: '抑郁'),
      SCLQuestion(id: 6, text: '对旁人责备求全', category: '人际关系敏感'),
      SCLQuestion(id: 7, text: '感到别人能控制你的思想', category: '精神病性'),
      SCLQuestion(id: 8, text: '责怪别人制造麻烦', category: '敌对'),
      SCLQuestion(id: 9, text: '忘记性大', category: '强迫症状'),
      SCLQuestion(id: 10, text: '担心自己的衣饰整齐及仪态的端正', category: '强迫症状'),
      SCLQuestion(id: 11, text: '容易烦恼和激动', category: '焦虑'),
      SCLQuestion(id: 12, text: '胸痛', category: '躯体化'),
      SCLQuestion(id: 13, text: '害怕空旷的场所或街道', category: '恐怖'),
      SCLQuestion(id: 14, text: '感到自己的精力下降，活动减慢', category: '抑郁'),
      SCLQuestion(id: 15, text: '想结束自己的生命', category: '抑郁'),
      SCLQuestion(id: 16, text: '听到旁人听不到的声音', category: '精神病性'),
      SCLQuestion(id: 17, text: '发抖', category: '焦虑'),
      SCLQuestion(id: 18, text: '感到大多数人都不可信任', category: '人际关系敏感'),
      SCLQuestion(id: 19, text: '胃口不好', category: '抑郁'),
      SCLQuestion(id: 20, text: '容易哭泣', category: '抑郁'),
      SCLQuestion(id: 21, text: '同异性相处时感到害羞不自在', category: '人际关系敏感'),
      SCLQuestion(id: 22, text: '感到受骗，中了圈套或有人想抓您', category: '偏执'),
      SCLQuestion(id: 23, text: '无缘无故地突然感到害怕', category: '焦虑'),
      SCLQuestion(id: 24, text: '自己不能控制地大发脾气', category: '敌对'),
      SCLQuestion(id: 25, text: '怕单独出门', category: '恐怖'),
      SCLQuestion(id: 26, text: '经常责怪自己', category: '抑郁'),
      SCLQuestion(id: 27, text: '腰痛', category: '躯体化'),
      SCLQuestion(id: 28, text: '感到难以完成任务', category: '强迫症状'),
      SCLQuestion(id: 29, text: '感到孤独', category: '抑郁'),
      SCLQuestion(id: 30, text: '感到苦闷', category: '抑郁'),
      SCLQuestion(id: 31, text: '过分担忧', category: '焦虑'),
      SCLQuestion(id: 32, text: '对事物不感兴趣', category: '抑郁'),
      SCLQuestion(id: 33, text: '感到害怕', category: '焦虑'),
      SCLQuestion(id: 34, text: '我的感情容易受到伤害', category: '人际关系敏感'),
      SCLQuestion(id: 35, text: '旁人能知道您的私下想法', category: '精神病性'),
      SCLQuestion(id: 36, text: '感到别人不理解您不同情您', category: '人际关系敏感'),
      SCLQuestion(id: 37, text: '感到人们对你不友好，不喜欢你', category: '人际关系敏感'),
      SCLQuestion(id: 38, text: '做事必须做得很慢以保证做得正确', category: '强迫症状'),
      SCLQuestion(id: 39, text: '心跳得很厉害', category: '焦虑'),
      SCLQuestion(id: 40, text: '恶心或胃部不舒服', category: '躯体化'),
      SCLQuestion(id: 41, text: '感到比不上他人', category: '人际关系敏感'),
      SCLQuestion(id: 42, text: '肌肉酸痛', category: '躯体化'),
      SCLQuestion(id: 43, text: '感到有人在监视您谈论您', category: '偏执'),
      SCLQuestion(id: 44, text: '难以入睡', category: '抑郁'),
      SCLQuestion(id: 45, text: '做事必须反复检查', category: '强迫症状'),
      SCLQuestion(id: 46, text: '难以作出决定', category: '强迫症状'),
      SCLQuestion(id: 47, text: '怕乘电车、公共汽车、地铁或火车', category: '恐怖'),
      SCLQuestion(id: 48, text: '呼吸有困难', category: '焦虑'),
      SCLQuestion(id: 49, text: '一阵阵发冷或发热', category: '躯体化'),
      SCLQuestion(id: 50, text: '因为感到害怕而避开某些东西，场合或活动', category: '恐怖'),
      SCLQuestion(id: 51, text: '脑子变空了', category: '精神病性'),
      SCLQuestion(id: 52, text: '身体发麻或刺痛', category: '躯体化'),
      SCLQuestion(id: 53, text: '喉咙有梗塞感', category: '躯体化'),
      SCLQuestion(id: 54, text: '感到对前途没有希望', category: '抑郁'),
      SCLQuestion(id: 55, text: '不能集中注意力', category: '强迫症状'),
      SCLQuestion(id: 56, text: '感到身体的某一部分软弱无力', category: '躯体化'),
      SCLQuestion(id: 57, text: '感到紧张或容易紧张', category: '焦虑'),
      SCLQuestion(id: 58, text: '感到手或脚发沉', category: '躯体化'),
      SCLQuestion(id: 59, text: '想到有关死亡的事', category: '抑郁'),
      SCLQuestion(id: 60, text: '吃得太多', category: '躯体化'),
      SCLQuestion(id: 61, text: '当别人看着您或谈论您时感到不自在', category: '人际关系敏感'),
      SCLQuestion(id: 62, text: '有一些不属于您自己的想法', category: '精神病性'),
      SCLQuestion(id: 63, text: '有想打人或伤害他人的冲动', category: '敌对'),
      SCLQuestion(id: 64, text: '醒得太早', category: '抑郁'),
      SCLQuestion(id: 65, text: '必须反复洗手、点数目或触摸某些东西', category: '强迫症状'),
      SCLQuestion(id: 66, text: '睡得不稳不深', category: '抑郁'),
      SCLQuestion(id: 67, text: '有想摔坏或破坏东西的冲动', category: '敌对'),
      SCLQuestion(id: 68, text: '有一些别人没有的想法或念头', category: '精神病性'),
      SCLQuestion(id: 69, text: '感到对别人神经过敏', category: '人际关系敏感'),
      SCLQuestion(id: 70, text: '在商店或电影院等人多的地方感到不自在', category: '恐怖'),
      SCLQuestion(id: 71, text: '感到任何事情都很难做', category: '抑郁'),
      SCLQuestion(id: 72, text: '一阵阵恐惧或惊恐', category: '焦虑'),
      SCLQuestion(id: 73, text: '感到在公共场合吃东西很不舒服', category: '恐怖'),
      SCLQuestion(id: 74, text: '经常与人争论', category: '敌对'),
      SCLQuestion(id: 75, text: '单独一人时神经很紧张', category: '恐怖'),
      SCLQuestion(id: 76, text: '别人对您的成绩没有作出恰当的评价', category: '偏执'),
      SCLQuestion(id: 77, text: '即使和别人在一起也感到孤单', category: '抑郁'),
      SCLQuestion(id: 78, text: '感到坐立不安心神不宁', category: '焦虑'),
      SCLQuestion(id: 79, text: '感到自己没有什么价值', category: '抑郁'),
      SCLQuestion(id: 80, text: '感到熟悉的东西变成陌生或不象是真的', category: '精神病性'),
      SCLQuestion(id: 81, text: '大叫或摔东西', category: '敌对'),
      SCLQuestion(id: 82, text: '害怕会在公共场合昏倒', category: '恐怖'),
      SCLQuestion(id: 83, text: '感到别人想占您的便宜', category: '偏执'),
      SCLQuestion(id: 84, text: '为一些有关"性"的想法而很苦恼', category: '精神病性'),
      SCLQuestion(id: 85, text: '认为应该因为自己的过错而受到惩罚', category: '抑郁'),
      SCLQuestion(id: 86, text: '感到要赶快把事情做完', category: '强迫症状'),
      SCLQuestion(id: 87, text: '感到自己的身体有严重问题', category: '躯体化'),
      SCLQuestion(id: 88, text: '从未感到和其他人很亲近', category: '人际关系敏感'),
      SCLQuestion(id: 89, text: '感到自己有罪', category: '抑郁'),
      SCLQuestion(id: 90, text: '感到自己的脑子有毛病', category: '精神病性'),
    ];
  }

  // 获取SCL-90因子分类
  static Map<String, List<int>> getSCLFactors() {
    return {
      '躯体化': [1, 4, 12, 27, 40, 42, 48, 49, 52, 53, 56, 58],
      '强迫症状': [3, 9, 10, 28, 38, 45, 46, 51, 55, 65],
      '人际关系敏感': [6, 21, 34, 36, 37, 41, 61, 69, 73],
      '抑郁': [5, 14, 15, 20, 22, 26, 29, 30, 31, 32, 54, 71, 79],
      '焦虑': [2, 17, 23, 33, 39, 57, 72, 78, 80, 86],
      '敌对': [11, 24, 63, 67, 74, 81],
      '恐怖': [13, 25, 47, 50, 70, 75, 82],
      '偏执': [8, 18, 43, 68, 76, 83],
      '精神病性': [7, 16, 35, 62, 77, 84, 85, 87, 88, 90],
      '其他': [19, 44, 59, 60, 64, 66, 89],
    };
  }
}
